"""

@author: lingw
@email: gw.lin@hzgosun.com
@file: ViewUserRoleManagementPage.py
@time: 2019-5-22 下午 2:04

这一行开始写关于本文件的说明与解释

"""

from common.poium import Page
from common.vue.float_window import FloatWindow
from common.vue.table import VueTable, VueTurnPage
from common.vue.label import ElementType as ET
from common.vue.label import ElementBaseLabel
from common.vue.search import VueSearch
from common.vue.tree import VueTree, VueBoxTree
from common.vue.region import VueRegion
from common.vue.button import VueButton
from common.vue.element import VueElements

class SearchTools(VueSearch):
    """查询区域"""

    search_role_name = ElementBaseLabel(ET.INPUT, "角色名称")
    click_btn = VueButton("检索")

    def __init__(self):
        super(SearchTools, self).__init__()

class Table(VueTable):
    """前台角色列表"""

    add_btn = VueButton("新建")

    def __init__(self):
        super(Table, self).__init__()

class AddViewUserRole(FloatWindow):
    """前台角色添加窗口"""

    add_role_name = ElementBaseLabel(ET.INPUT, "角色名称")
    page_role = VueBoxTree(index=0)

    def __init__(self, title=None, index=None):
        super(AddViewUserRole, self).__init__(title=title, index=index)


class ModifyViewUserRole(AddViewUserRole):
    """前台角色修改窗口"""

    page_role = VueBoxTree(index=1)

    def __init__(self, title=None, index=None):
        super(ModifyViewUserRole, self).__init__(title=title, index=index)


class ViewUserRoleManagementPage(Page):
    """前台角色管理页面"""

    searchTools = SearchTools()
    table = Table()
    addViewUserRole = AddViewUserRole(index=1)
    modifyViewUserRole = ModifyViewUserRole(title='角色编辑')
    turnPage = VueTurnPage()





